xen: arm: bootfdt: Avoid reading off the front of *_cells array
authorIan Campbell <ian.campbell@citrix.com>
Thu, 16 Jul 2015 08:50:07 +0000 (09:50 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 16 Jul 2015 15:25:26 +0000 (16:25 +0100)
commit989f3939bd16a0e1669c179b6c5c264812a25fc2
treef55b4d21c1072e5fcc436dcd5eca5a47d0f79ecb
parent07c77aabadad30dada798be6d61cf9adc64de533
xen: arm: bootfdt: Avoid reading off the front of *_cells array

In device_tree_for_each_node the call to the callback was using
{address,size}_cells[depth - 1], which at depth 0 could read off the
front of the array.

We already handled this correctly in the rest of the loop so fixup
this instance as well.

Reported-by: Chris (Christopher) Brand <chris.brand@broadcom.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Chris (Christopher) Brand <chris.brand@broadcom.com>
Reviewed-by: Julien Grall <julien.grall@citrix.com>
xen/arch/arm/bootfdt.c